package concurrency;

import net.mindview.util.Enums;

enum Course {
    APPETIZER(Food.Appetizer.class),
    MAINCOURSE(Food.MainCourse.class),
    DESSERT(Food.Dessert.class),
    COFFEE(Food.Coffee.class);

    private Food[] mValues;

    private Course(Class<? extends Food> kind) {
        mValues = kind.getEnumConstants();
    }

    public Food randomSelection() {
        return Enums.random(mValues);
    }
}
